import request from '@/utils/request'

// 查询出库作业列表
export function listTask(query) {
  return request({
    url: '/exitwarehouse/exit/list',
    method: 'get',
    params: query
  })
}

// 查询出库作业详细
export function getTask(exitWarehouseId) {
  return request({
    url: '/exitwarehouse/exit/' + exitWarehouseId,
    method: 'get'
  })
}

// 新增出库作业
export function addTask(data) {
  return request({
    url: '/exitwarehouse/exit',
    method: 'post',
    data: data
  })
}

// 修改出库作业
export function updateTask(data) {
  return request({
    url: '/exitwarehouse/exit',
    method: 'put',
    data: data
  })
}

// 删除出库作业
export function delTask(exitWarehouseId) {
  return request({
    url: '/exitwarehouse/exit/' + exitWarehouseId,
    method: 'delete'
  })
}

// 修改出库状态
export function confirmExitWarehouse(data) {
  return request({
    url: '/exitwarehouse/exit/confirm',
    method: 'put',
    data: data
  })
}

// 查询重量
export function getExitWeightSum(query) {
  return request({
    url: '/exitwarehouse/exit/exitweightsum',
    method: 'get',
    params: query
  })
}

// 修改货物出库编号
export function updateGoodExitWarehouseNumber(goodsIds, exitWarehouseNumber, data) {
  return request({
    url: '/exitwarehouse/exit/exitnumber/' + goodsIds + '/' + exitWarehouseNumber,
    method: 'put',
    data: data
  })
}

// 移除货物出库编号
export function removeGoodExitWarehouseNumber(goodsId, exitWarehouseNumber) {
  return request({
    url: '/exitwarehouse/exit/exitnumber/' + goodsId + '/' + exitWarehouseNumber,
    method: 'delete'
  })
}

// 查询重量
export function getWeightMode(contractNumber) {
  return request({
    url: '/exitwarehouse/exit/weightmode/' + contractNumber,
    method: 'get',
//    params: query
  })
}
